package cn.itcast.controller;

import cn.itcast.entity.Note;
import cn.itcast.entity.Result;
import cn.itcast.service.NoteService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@CrossOrigin
@RestController
@RequestMapping("/note")
public class NoteController {
    @Autowired
    private NoteService noteService;

    @PostMapping("/add")
    public Result add(@RequestBody Note note) throws Exception {
        noteService.add(note);
        return Result.success();
    }
}
